<h1>Map View Specific Sample Page</h1>
<?php
$connected = @fsockopen("www.google.com", [80|443]); //website and port
if($connected){
	$is_conn = true; //action when connected
	fclose($connected);
	$specLatLng;
	//
	// ext is your protected.extensions folder
	// gmaps means the subfolder name under your protected.extensions folder
	//
	//echo   "<pre>";
	//print_r($projects);
	//echo   "<pre>";
	Yii::import('ext.egmap.*');
	$gMap = new EGMap();
	$gMap->zoom = 6;
	$mapTypeControlOptions = array(
	  'position'=> EGMapControlPosition::LEFT_BOTTOM,
	  'style'=>EGMap::MAPTYPECONTROL_STYLE_DROPDOWN_MENU
	);
	 
	$gMap->mapTypeControlOptions= $mapTypeControlOptions;
	 
	//$gMap->setCenter(39.721089311812094, 2.91165944519042);
	//12.46876,122.67334
	$gMap->setCenter(12.46876,122.67334);

	// Create GMapInfoWindows
	$info_window_b = new EGMapInfoWindow('Hey! I am a marker with label!');
	//$icon = new EGMapMarkerImage("https://google-maps-icons.googlecode.com/files/housesolarpanel.png");
	//Yii::app()->request->baseUrl
	$icon = new EGMapMarkerImage(Yii::app()->request->baseUrl."/images/home.png");
	$icon->setSize(32, 37);
	$icon->setAnchor(16, 16.5);
	$icon->setOrigin(0, 0);
	foreach($projects as $value){
		$arlatlong = explode(', ',$value->latlng);
		//print_r($arlatlong);
		//exit;
		$htmlPart = '';
		$info_window_a = new EGMapInfoWindow('<div>This is a property!</div>');
		$marker = new EGMapMarker($arlatlong[0], $arlatlong[1], array('title' => 'Somewhere in Manila','icon'=>$icon));
		$marker->addHtmlInfoWindow($info_window_a);
		$gMap->addMarker($marker);
	} 
	$gMap->renderMap();
	}else{
		$is_conn = false; //action in connection failure
	}
	return $is_conn;
?>
